﻿using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata;

namespace AD.Pms.DataBase.Models.ZC_Comment
{
    public partial class ZC_CommentContext : DbContext
    {
        public ZC_CommentContext()
        {
        }

        public ZC_CommentContext(DbContextOptions<ZC_CommentContext> options)
            : base(options)
        {
        }

        public virtual DbSet<TblFeedback> TblFeedback { get; set; }

//        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
//        {
//            if (!optionsBuilder.IsConfigured)
//            {
//#warning To protect potentially sensitive information in your connection string, you should move it out of source code. See http://go.microsoft.com/fwlink/?LinkId=723263 for guidance on storing connection strings.
//                optionsBuilder.UseSqlServer("Server=47.101.182.15,9010;Database=ZC_Comment;Trusted_Connection=False;User ID=sa;Password=Mic123@321");
//            }
//        }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.Entity<TblFeedback>(entity =>
            {
                entity.HasKey(e => e.Pkid);

                entity.ToTable("tbl_Feedback");

                entity.Property(e => e.Pkid).HasColumnName("PKID");

                entity.Property(e => e.Content).HasMaxLength(2000);

                entity.Property(e => e.CreateBy)
                    .HasMaxLength(50)
                    .IsUnicode(false);

                entity.Property(e => e.CreateTime)
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("(getdate())");

                entity.Property(e => e.FileList).HasMaxLength(500);

                entity.Property(e => e.Ip)
                    .HasColumnName("IP")
                    .HasMaxLength(50)
                    .IsUnicode(false);

                entity.Property(e => e.Iplocal)
                    .HasColumnName("IPLocal")
                    .HasMaxLength(50);

                entity.Property(e => e.IsDelete).HasDefaultValueSql("((0))");

                entity.Property(e => e.SolveResult).HasMaxLength(500);

                entity.Property(e => e.SolveTime).HasColumnType("datetime");

                entity.Property(e => e.Type).HasMaxLength(50);

                entity.Property(e => e.Ua)
                    .HasColumnName("UA")
                    .HasMaxLength(200);

                entity.Property(e => e.UpdateBy)
                    .HasMaxLength(50)
                    .IsUnicode(false);

                entity.Property(e => e.UpdateTime)
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("(getdate())");

                entity.Property(e => e.UserContact).HasMaxLength(50);

                entity.Property(e => e.UserId).HasColumnName("UserID");
            });
        }
    }
}
